home *** CD-ROM | disk | FTP | other *** search
/ SPACE 2 / SPACE - Library 2 - Volume 1.iso / program / 316 / libsrc / perror.c < prev    next >
Encoding:
C/C++ Source or Header  |  1988-10-20  |  317 b   |  18 lines

  1.  
  2. /* more guesswork and kludgery... */
  3.  
  4. #include <errno.h>
  5. #include <stdio.h>
  6.  
  7. void perror(msg)
  8. char * msg;
  9. {
  10.   if ((errno < sys_nerr) || (errno > 0))
  11.     fprintf(stderr, "Unknown error");
  12.     else
  13.     fprintf(stderr, sys_errlist[errno]);
  14.   if (msg)
  15.     fprintf(stderr, " %s", msg);
  16.   fprintf(stderr, "\n");
  17. }
  18.